package cp3120.net;

import cp3120.model.User;

/**
 *
 * @author Adam Scarr <scarr.adam@gmail.com>
 */
public class ActiveUser {
    private static UserProvider provider;

    public static User getUser() {
        return provider.getUser();
    }

    public synchronized static void setProvider(UserProvider provider) {
        ActiveUser.provider = provider;
    }

    public synchronized static boolean hasPermission(String permission) {
        return provider.getUser().hasPermission(permission);
    }

    public static void setUser(User user) {
        provider.setUser(user);
    }
}
